package com.cictec.middleware.gps.engine;

import java.util.Date;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import com.cictec.middleware.commons.utils.PMSUtils;

/**
 * 时序对象。是指在业务处理过程中生成的业务对象，比如位置点、时段对象，报警对象等。
 * 
 * @author Zhibin
 *
 */
@SuppressWarnings("serial")
public class TimingObject implements java.io.Serializable {

	/** * 时序对象当前时间 */
	private Date time;

	/**
	 * 属性集合
	 */
	private Map<String, String> attributes = new ConcurrentHashMap<String, String>();

	public void setAttribute(String key, String value) {
		attributes.put(key, value);
	}

	public String getAttribute(String key) {
		return PMSUtils.isNull(attributes.get(key));
	}
	
	/** * 时序对象当前时间 */
	public Date getTime() {
		return time;
	}
	/** * 时序对象当前时间 */
	public void setTime(Date time) {
		this.time = time;
	}

	public Map<String, String> getAttributes() {
		return attributes;
	}

	public void setAttributes(Map<String, String> attributes) {
		this.attributes = attributes;
//		this.attributes = new ConcurrentHashMap<String, String>();
//		attributes.putAll(attributes);
	}

}
